package labilabyrinth.serializable;

import java.io.Serializable;
import java.util.ArrayList;
import android.graphics.RectF;

public class Level implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int index;
	private String name;
	private MyPointF ballPosition;	
	private ArrayList<MyRectF> obstacles;
	private ArrayList<Hole> holes;
	
	public int getIndex() {
		return index;
	}

	public String getName() {
		return name;
	}

	public MyPointF getBallPosition() {
		return ballPosition;
	}

	public ArrayList<MyRectF> getObstacles() {
		return obstacles;
	}

	public ArrayList<Hole> getHoles() {
		return holes;
	}

	public Level(int index,String name){
		this.index = index;
		this.name = name;
		obstacles =  new ArrayList<MyRectF>();
		holes = new ArrayList<Hole>();
		ballPosition = new MyPointF();
	}
	
	public void setBallPosition(int x, int y){
		ballPosition.x = x;
		ballPosition.y = y;
	}
	
	public void addObstacle(RectF o){
		MyRectF r = new MyRectF(o.left, o.top, o.right, o.bottom);
		obstacles.add(r);
	}
	
	public void addHole(Hole h){
		holes.add(h);
	}
	
	public String toString(){
		return Integer.toString(index)+name+".lvl"+" ["+ballPosition.x+","+ballPosition.y+"] "+obstacles.size();
	}

}
